class Solution(object):
    def baseNeg2(self, n):
        if n == 0:
            return '0'
        t = ''
        while n != 0:
            n, mod = n // -2, n % -2
            if mod == -1:
                mod = 1
                n += 1
            t += str(mod)
        return t[::-1]